home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
pascal
/
wndw40.zip
/
WNDWDEMO.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1987-12-11
|
23KB
|
679 lines
{ =========================================================================== }
{ WndwDemo.pas - Multi-level window demo for WNDW40.TPU ver 4.0, 12-12-87 }
{ }
{ This program shows you some of basic window utilities. It only shows }
{ access any window at any time. You can even hide the top level window for }
{ displaying later. }
{ =========================================================================== }
program WindowDemo;
{$M 16384, 22000, 22000 }
{$R-,S-,I+,D-,T-,F-,V-,B-,N-,L+ }
uses Crt,Qwik,WndwVars,Wndw;
type
Str80 = string[80];
Steps = (Step0,Step1,Step2,Step3,Step3b,Step3c,Step4,Step5,Step5b,Step6,
Step7,Step8,Step9,Step9b,Step9c,Step11,Step12,Step13,Step14,
Step15,Step16,Step17);
var
Step: Steps;
i,j,k,m,OldCursor: word;
Battr,Wattr: integer;
Key: char;
const
FuncKey = #00;
RetKey = #13;
EscKey = #27;
StrA : array [1..17] of Str80 = (
'The windowing utilities in the file WNDW40.ARC',
'combined with QWIK40.ARC are ShareWare routines',
'that allow Turbo Pascal 4.0 to create incredibly',
'fast multi-level random-access windows. Here is',
'the kind of windows you can create:',
'',
' Size: 2x2 to screen limits',
' Colors: 256 for window and/or border',
' Borders: 12 styles, 2 custom, or no border',
' Partitions: Horizontal, vertical and cross',
' Column mode: 40/80/variable',
' Text modes: All (0..3, 7)',
'',
'These windows can be accessed at any level, shuf-',
'fled around, or even moved by the end user. These',
'utilities automatically configure to your video',
'card(s) and mode for the greatest speed.');
StrB : array [1..11] of Str80 = (
'WNW40.ARC consists of fourteen utilities:',
'',
' InitWindow TitleWindow',
' SetWindowModes ClearTitle',
' MakeWindow ClearWindow',
' PartitionWindow HideWindow',
' PartitionCross ShowWindow',
' ScrollWindow MoveWindow',
' RemoveWindow AccessWindow',
'',
'and are described in the following windows:');
StrC : array [1..6] of Str80 = (
'FORMAT: InitWindow (WindowAttr: byte, ClearScr: boolean);',
'',
'InitWindow initializes 24 variables needed by the utilities.',
'You can select the foreground and background colors of the',
'initial screen display with the option to clear the screen.',
'InitWindow must be called before using any other procedures.');
StrC1 : array [1..12] of Str80 = (
'FORMAT: SetWindowModes (SumOfAllModes: byte);',
'',
'SetWindowModes is any easy way to set the following window mode',
'constants saved in the global variable WindowModes:',
'',
' PermMode = $01 - Can''t be moved or removed; no underlay',
' FixedMode = $02 - Can''t be moved or accessed',
' ShadowLeft = $04 - Shadow on the left side',
' ShadowRight = $08 - Shadow on the right side',
' ZoomMode = $10 - Zoom effect on Make and AccessWindow',
'',
'WindowModes is maintained for subsequent windows until changed.');
StrC2: array [1..9] of Str80 = (
'CGA:',
'The CGA is self-regulating and controls the',
'zoom rate.',
'MDA, EGA, MCGA, VGA, Hercules, and others:',
'These video cards are quite fast and need a',
'delay for the effect. A default value of 12',
'or 18 milliseconds is used in "ZoomDelay",',
'the latter is used on faster 80286/80386',
'machines.');
StrD1 : array [1..16] of Str80 = (
'FORMAT: MakeWindow (Row,Col,Rows,Cols: byte; Wattr,Battr: integer;',
' BrdrSel: Borders; WindowName: WindowNames);',
'',
'MakeWindow creates a new blank window starting at (row,col) and',
'extending for a number of rows and columns (rows,cols). If a border',
'exists, the Turbo window will be shrunk within the borders. A name',
'serves as an ID for random access. The border can be any one of the',
'following:',
'',
' NoBrdr - just window EvenSolidBrdr - evenly solid',
' BlankBrdr - blank spaces ThinSolidBrdr1 - thin solid line',
' SingleBrdr - single line ThinSolidBrdr2 - thin solid line',
' DoubleBrdr - double line LhatchBrdr - light hatch',
' HdoubleBrdr - horiz double MhatchBrdr - medium hatch',
' VdoubleBrdr - vert double HhatchBrdr - heavy hatch',
' SolidBrdr - solid UserBrdr1/2 - user defined borders');
StrD2 : array [1..6] of Str80 = (
'FORMAT: PartitionWindow (Direction: DirType; RowOrCol: byte);',
' PartitionCross (WindowRow,WindowCol: byte);',
'Partitions can be made inside any window with a border as shown.',
'Simply specify the direction (Horiz/Vertical) and the location',
'relative to the Turbo window. A PartitionCross is needed where',
'both the vertcial and horizontal intersect.');
StrE : array [1..4] of Str80 = (
'FORMAT: RemoveWindow;',
'RemoveWindow removes the top level',
'window from the screen and also',
'from memory.');
StrF : array [1..2] of Str80 = (
'See if your BIOS gives you flicker',
'when your screen rolls down next ...');
StrG : array [1..16] of Str80 = (
'',
'FORMAT: ScrollWindow (RowBegin,RowEnd: byte; Dir: DirType);',
'',
'Turbo''s standard procedures InsLine and DelLine may have worked just',
'fine this window. However, if your screen just had some bad flicker',
'as it was scrolling down, your BIOS is not flicker-free. To keep the',
'display flicker-free, to work on other video pages, VGA, or EGA, then',
'you will need this procedure. The upward scroll used ScrollWindow,',
'so no flicker was seen then. It also scrolls partial windows.',
'',
'The direction of scroll can be either of the following:',
'',
' ''Up'' - to scroll up',
' ''Down'' - to scroll down',
'',
'');
StrH : array [1..5] of Str80 = (
'FORMAT: TitleWindow (TopOrBottom,Justify: DirType;',
' Title: string);',
'TitleWindow places a title in the top or bottom',
'border of the current window. Justify permits Left,',
'Center, or Right justification of the title.');
StrH2 : array [1..3] of Str80 = (
'FORMAT: ClearTitle (TopOrBottom: DirType);',
'ClearTitle clears the entire top or bottom',
'border of a title by restoring the border.');
StrH3 : array [1..4] of Str80 = (
'FORMAT: ClearWindow;',
'ClearWindow works just',
'like ClrScr, but also',
'on any video page.');
StrJ : array [1..5] of Str80 = (
'The maximum number of windows that',
'may be on the screen at any one time',
'is specified by the constant',
'"MaxWndw". Assign it in the unit',
'called WNDWVARS.PAS.');
StrK : array [1..10] of Str80 = (
'In addition to windows, there are 17 powerful',
'QWIK screen write procedures you can use:',
' Qwrite QfillC GotoRC',
' QwriteC Qfill CursorChange',
' QwriteA QstoreToMem CursorOn',
' Qattr QstoreToScr CursorOff',
' QattrC QviewPage WhereR',
' QwritePage WhereC',
'In QWIK40.ARC, compile and run QWIKDEMO.PAS to',
' see all of the features.');
StrL : array [1..20] of Str80 = (
'The procedures are used as follows:',
'',
' program YourProgram;',
' uses Qwik,Crt,WndwVars,Wndw;',
' ...Your variables and procedures...',
' begin',
' InitWindow (WindowAttr,ClearScr);',
' SetWindowModes (SumOfAllModes);',
' MakeWindow (Row,Col,Rows,Cols,Wattr,Battr,',
' BrdrSelection,WindowName);',
' Pa